package tsg.laf;

import java.util.concurrent.ConcurrentHashMap;

import tsg.graphic.Color;
import tsg.graphic.Font;
import tsg.graphic.Image;
import tsg.laf.eventhorizon.EventHorizonLookAndFeel;

public class LookAndFeelManager 
{	
	private LookAndFeelManager()
	{
		_defaults = new ConcurrentHashMap<String, Object>();
		LookAndFeelManager.setLookAndFeel(new EventHorizonLookAndFeel());
	}
	
	public static void setLookAndFeel(LookAndFeel lookAndFeel)
	{
		lookAndFeel.installLookAndFeel();
	}
	
	public static Object get(String key)
	{
		return _defaults.get(key);
	}
	
	public static String getString(String key)
	{
		return (String) _defaults.get(key);
	}
	
	public static int getInt(String key)
	{
		return (Integer) _defaults.get(key);
	}
	
	public static float getFloat(String key)
	{
		return (Float) _defaults.get(key);
	}
	
	public static long getLong(String key)
	{
		return (Long) _defaults.get(key);
	}
	
	public static double getDouble(String key)
	{
		return (Double) _defaults.get(key);
	}
	
	public static Image getImage(String key)
	{
		return (Image) _defaults.get(key);
	}
	
	public static Color getColor(String key)
	{
		return (Color) _defaults.get(key);
	}
	
	public static LookAndFeel getLookAndFeel(String key)
	{
		return (LookAndFeel) _defaults.get(key);
	}
	
	public static Class<?> getClass(String key)
	{
		return (Class<?>) _defaults.get(key);
	}
	
	public static ComponentUI getComponentUI(String key)
	{
		return (ComponentUI) _defaults.get(key);
	}
	
	public static Font getFont(String key)
	{
		return (Font) _defaults.get(key);
	}
	
	public static void put(String key, Object value)
	{
		_defaults.put(key, value);
	}
	
	public static void clear()
	{
		_defaults.clear();
	}
	
	public static LookAndFeelManager getInstance()
	{
		return _singleton;
	}
	
	private static ConcurrentHashMap<String, Object> _defaults;
	private static LookAndFeelManager				 _singleton		= new LookAndFeelManager();
}








